<extend name="Public/frame"/>
<block name="page_body">

    <div class="layout-container">
        <form class="tpx-ajaxsubmit" role="form" action="{:U(CONTROLLER_NAME.'/post_handle?action=edit&id='.$data_id)}" method="post">
            <div class="post-tools">
                <div style="padding:10px;">
                    <div>
                        <a class="btn btn-default btn-xs btn-block" href="{:U('Document/mylist')}">
                            返回
                        </a>
                    </div><br />
                    <div>
                        <select id="cat_id" class="form-control input-sm">
                            <option value="0">选择分类</option>
                            <foreach name="data_cat_list" item="i">
                                <option value="{$i.id}" <if condition="$data_one['cat_id'] eq $i['id']">selected</if>>{$i.title|htmlspecialchars}</option>
                            </foreach>
                        </select>
                    </div><br />
                    <button type="button" class="command-save btn btn-primary btn-xs btn-block">保存(Ctrl-S)</button><br />
                    <div id="autoSaveStatus" style="font-size:12px;color:#999;text-align:center;"></div>
                    <div>
                        <if condition="$data_one['out_id']">
                            <a class="btn btn-default btn-xs btn-block" href="http://{$Think.const.HTTP_HOST}/doc/{$data_one.out_id}:preview" target="_blank">预览</a>
                            <a class="btn btn-default btn-xs btn-block" href="http://{$Think.const.HTTP_HOST}/doc/download/out_id/{$data_one.out_id}" target="_blank">Html下载</a>
                            <a class="btn btn-default btn-xs btn-block" href="http://{$Think.const.HTTP_HOST}/doc/{$data_one.out_id}:print" target="_blank">生成PDF</a>
                        </if>
                    </div>
                </div>
            </div>
            <div class="post-body">
                <div>
                    <input type="text" class="form-control" id="title" required="true" value="{$data_one.title|htmlspecialchars}" placeholder="输入文档标题" onkeypress="if(event.keyCode==13)return false;" />
                    <input type="hidden" id="id" value="{$data_id}" />
                </div>
                <div>
                    <iframe src="{:U('Document/post_md')}" style="border:0;width:100%;" id="frame_content"></iframe>
                </div>

            </div>
        </form>
    </div>

    <include file="Public/footer"/>

</block>